from ctypes import *
from cpmem.rtl import RTLMem
from rtl.libsuffix import suffix

class rx(RTLMem):
    def __init__(self,config,port_id=0):
        self.config = config
        fn = self.config.c_lib_dir + "librtlmmap" + suffix()
        RTLMem.__init__(self,fn)
        memfn = "rx_rtl.{}".format(port_id)
        self.h = self.lib.attachMem(memfn.encode(encoding="utf-8"))
    
